package cn.iocoder.yudao.module.alipay.dal.mysql.infoproductiontype;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.alipay.dal.dataobject.infoproductiontype.InfoProductionTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.alipay.controller.admin.infoproductiontype.vo.*;

/**
 * 作品分类 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface InfoProductionTypeMapper extends BaseMapperX<InfoProductionTypeDO> {

    default PageResult<InfoProductionTypeDO> selectPage(InfoProductionTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InfoProductionTypeDO>()
                .likeIfPresent(InfoProductionTypeDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(InfoProductionTypeDO::getTypeDescribe, reqVO.getTypeDescribe())
                .eqIfPresent(InfoProductionTypeDO::getSort, reqVO.getSort())
                .betweenIfPresent(InfoProductionTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InfoProductionTypeDO::getId));
    }

    default List<InfoProductionTypeDO> selectList(InfoProductionTypeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<InfoProductionTypeDO>()
                .likeIfPresent(InfoProductionTypeDO::getTypeName, reqVO.getTypeName())
                .eqIfPresent(InfoProductionTypeDO::getTypeDescribe, reqVO.getTypeDescribe())
                .eqIfPresent(InfoProductionTypeDO::getSort, reqVO.getSort())
                .betweenIfPresent(InfoProductionTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InfoProductionTypeDO::getId));
    }

}
